import http from './http'

interface UserRole {
  ruId?: number
  userId: number
  roleId: number
}

// 通过ID查询
export const queryRoleById = (ruId: number) => {
  return http.get(`/userRole/${ruId}`)
}

// 全部查询
export const queryAllRole = () => {
  return http.get(`/userRole/all`)
}

// 新增
export const addRole = (data: UserRole) => {
  return http.post('/userRole', data)
}

// 修改
export const updateRole = (data: UserRole) => {
  return http.put('/userRole', data)
}

// 删除
export const deleteRole = (id: number) => {
  return http.delete(`/userRole/${id}`)
}

